/*
 * @Author: wangyingjie 2778809626@qq.com
 * @Date: 2025-11-19 13:45:15
 * @LastEditors: wangyingjie 2778809626@qq.com
 * @LastEditTime: 2025-11-20 14:01:43
 * @FilePath: \VTKModelStudio\VTKModelStudioMainWindow.h
 * @Description:
 */

#ifndef VTKMODELSTUDIOMAINWINDOW_H
#define VTKMODELSTUDIOMAINWINDOW_H

// #include "core_lib_export.h"

#include "VTKModelStudio.h"
#include "ElaWindow.h"
#include <QDebug>
#include "SettingPage.H"

#include "ElaToolBar.h"
#include "ElaToolButton.h"

class VTKModelStudioMainWindow : public ElaWindow
{
    Q_OBJECT

  public:
    explicit VTKModelStudioMainWindow(QWidget* parent = nullptr);
    ~VTKModelStudioMainWindow();

  private Q_SLOTS:

    void onOpenModel();
    void onCloseModel();
    void onScreenshot();
    void onLoadDefaultSTL();
    void onLoadDefaultMOD();
    void onLoadDefaultOBJ();
    void onRandomRotation(); 

    void onModelLoadedChanged(bool loaded)
    {
        qDebug() << "Model loaded:" << loaded;
    }

    void onErrorOccurred(const QString& error)
    {
        qWarning() << "Error:" << error;
    }

  private:
    void setupUI();
    void setupConnections();
    void setupToolBar(); 
     void updateRandomRotation();  // 执行随机转动更新

  private:
    VTKModelStudio* m_studio;
    QWidget* m_vtkPage;
    SettingPage *m_settingPage;

    ElaToolBar* m_toolBar;
    ElaToolButton* m_openButton;
    ElaToolButton* m_closeButton;
    ElaToolButton* m_screenshotButton;
    ElaToolButton* m_loadSTLButton;
    ElaToolButton* m_loadMODButton;
    ElaToolButton* m_loadOBJButton;
    ElaToolButton* m_Button;

    ElaToolButton* m_randomRotationButton;  // 随机转动按钮
    QTimer* m_randomRotationTimer;  // 随机转动定时器
    bool m_randomRotationEnabled;   // 随机转动状态标志
};




#endif // VTKMODELSTUDIOMAINWINDOW_H